package com.tools.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.tools.dao.StudentDao;
import com.tools.entity.Student;
import com.tools.mapper.StudentMapper;

@Repository(value = "studentDao")
public class StudentDaoImpl implements StudentDao {
    
    @Resource(name = "studentMapper")
    private StudentMapper studentMapper;
    
    public List<Student> getList(String condition) {
        // TODO Auto-generated method stub
        String sql = "select * from student where 1=1 " + condition;
        return studentMapper.getList(sql);
    }
    
    public Student fetchById(int id) {
        // TODO Auto-generated method stub
        return studentMapper.fetchById(id);
        
    }
}
